# coding: utf-8

import pandas as pd

df_ratings = pd.read_csv(
    r'F:\Work\Python\Pandas\study-pandas\file\datas\mov\ratings.dat',
    sep = '::',
    engine = 'python',
    names = ['userID', 'movieID', 'rating', 'timestamp']
)
#print(df_ratings.head())

df_users = pd.read_csv(
    r'F:\Work\Python\Pandas\study-pandas\file\datas\mov\users.dat',
    sep = '::',
    engine = 'python',
    names = ['userID', 'gender', 'age', 'occupation', 'zipcode']
)
#print(df_users.head())

df_movies = pd.read_csv(
    r'F:\Work\Python\Pandas\study-pandas\file\datas\mov\movies.dat',
    sep = '::',
    engine = 'python',
    names = ['movieID', 'title', 'genres']
)
#print(df_movies.head())

df_ratings_users = pd.merge(df_ratings, df_users, on = 'userID', how = 'inner')
print(df_ratings_users.head())
